>Are you sure you are creating the embedded frame with an ODShape zero
>based (top left corner of the bounding box should be (0,0))?
Yes, I am using the same code as ODFContainer.
>>All the sample ODF parts
>>(Draw, Container, Embed) do end up calling ChangeFrameShapes as a side
>>effect of how they work.
>I tried reproducing your problem with ODFDraw (ODF 2 version but it
>should be the same as ODF 1) and it doesn't call
>FW_MProxy::ChangeFrameShapes when a stationery is dragged in or when
>a document is opened with embedded frames.
When ODFContainer's SingleEmbeddedFrameInteralized is called, it sets the frameLoc to the middle of the contentView. Facets are then created. Next, the DropCommand offsets the part to the location of the mouse where the drop occurred. The offset code calls the proxy's ChangeFrameShape. Set a breakpoint in FW_MProxy::ChangeFrameShapes to see the details. ODFDraw works the same way. A similar process happens in the Insert command.
I have figured out the root my problem, however. The ODFClock sets the bounds of its used shape such that the used shape does not start at (0,0) within the frame (which is perfectly legal). I have code in UsedShapeChanged that sets the embedded part's external transforms such that the top left of the part's used shape is always in the same position as the top left of the facet I create for it. This is necessary given the nature of the way my part handles layout (an outline).
This scheme works just fine except for in 1 case -- when the part changes its used shape right when I create a new facet for it. At that point, my call to ChangeExternalTransforms in UsedShapeChanged has no effect. I'm not sure why that is, but it is true for every part, not just the clock. My current hunch is that it is because the embedded frame's FacetAdded has not been called yet, but that's just a guess. My workaround is to make sure I always call ChangeExternalTransforms after the process of creating the facets is complete.
Any ideas about why the call to ChangeExternalTransforms in UsedShapeChanged doesn't work when creating a facet?